package com.test.mchelepesa.util_rice.analytics_rice.bean_rice

import android.content.pm.PackageManager
import android.os.Build
import com.test.mchelepesa.activity_fragment_rice.base_rice.BaseApplication_rice
import com.test.mchelepesa.constant_rice.Constant_rice
import com.test.mchelepesa.util_rice.analytics_rice.util_rice.AnalyticsUtil_rice
import com.test.mchelepesa.util_rice.analytics_rice.util_rice.FirebaseUtil_rice
import java.util.*

class ParamFirebaseS2S_rice(
    /** 产品名 */
    var name: String = Constant_rice.NAME,
    /** 版本号 */
    var OSAndVersion: String = "Android ${Build.VERSION.RELEASE}",
    /** 语言 */
    var locale: String = Locale.getDefault().toString(),
    /** 设备 */
    var device: String = Build.MODEL,
    /** app版本号 */
    var appVersion: String = BaseApplication_rice.gApplication_rice().versionCodeStr,
    /** sdk版本号 */
    var sdkVersion: String = BaseApplication_rice.gApplication_rice().versionCodeStr,
    /** build */
    var build: String = "Build/${Build.ID}",
    /** 广告是否限制跟踪 */
    var lat: String = AnalyticsUtil_rice.getAdEnabled().toString(),
    /** firebasse id */
    var firebaseAppId: String = FirebaseUtil_rice.getFirebaseAppId(),
    /** ga4 id */
    var ga4AppInstanceId: String = FirebaseUtil_rice.getGa4InstanceId()
) : ParamBase_rice() {
    init {
        //组装版本号
        val vVersion =
            BaseApplication_rice.gApplication_rice().packageManager.getPackageInfo(
                BaseApplication_rice.gApplication_rice().packageName,
                PackageManager.GET_META_DATA
            ).versionName
        this.appVersion = vVersion ?: ""
        this.sdkVersion = vVersion ?: ""
    }
}


